package cn.threewaters.qtyy.config.shiro;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;

import cn.threewaters.qtyy.dit.one.entity.SysUser;

public class ShiroManager {
	public static Subject getSubject() {
		return SecurityUtils.getSubject();
	}

	public static Session getSession() {
		return getSubject().getSession();
	}

	public static String getUsername() {
		return ((SysUser) getSubject().getPrincipal()).getUsername();
	}

	public static SysUser getUserInfo() {
		return (SysUser) getSubject().getPrincipal();
	}

}
